//
//  HTAPI.h
//  hunter
//
//  Created by MEOS on 15/7/13.
//  Copyright (c) 2015年 HT. All rights reserved.
//


#import "AFHTTPRequestOperationManager.h"
#import "MTLJSONAdapter.h"

typedef void (^APIClientConstructingBodyWithBlock)(id<AFMultipartFormData> formData);
typedef void (^APIClientSuccess)(AFHTTPRequestOperation *operation, id responseObject);
typedef void (^APIClientFailure)(AFHTTPRequestOperation *operation, NSString *errorMessage);
typedef void (^UploadProgressBlock)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite);
typedef void (^DownloadProgressBlock)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead);

typedef void (^YWGetVerificationCodeResponseBlock)(BOOL success, id responseObject);


@interface HTAPI : AFHTTPRequestOperationManager

+ (instancetype)shareInstance;
- (AFHTTPRequestOperation *)performGetRequestWithURL:(NSString *)_url
                                          parameters:(NSDictionary *)_parameters
                                             success:(APIClientSuccess)_success
                                             failure:(APIClientFailure)_failure;


- (AFHTTPRequestOperation *)performPostRequestWithURL:(NSString *)_url
                                           parameters:(NSDictionary *)_parameters
                                              success:(APIClientSuccess)_success
                                              failure:(APIClientFailure)_failure;


- (AFHTTPRequestOperation *)performPostRequestWithURL:(NSString *)_url
                                           parameters:(NSDictionary *)_parameters
                            constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
                                              success:(APIClientSuccess)_success
                                              failure:(APIClientFailure)_failure;

//*****

//* 登录
- (void)loginWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//* 2.2获取用户信息
- (void)getUserInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//* 2.3获取用户实名信息
- (void)getUserRealInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;






//* 2.3.1上传身份认证图片
- (void)uploadRealInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 2.3.2提交身份认证信息
- (void)confirmRealInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 2.4上获取猎手江湖
- (void)userListInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 2.5获取猎手银行卡
- (void)userBankListInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 2.6添加绑定银行卡
- (void)addUserBankInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.7 解除绑定银行卡
- (void)deleteUserBankInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 2.8获取站内信列表
- (void)messageListInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.9获取站内信回复列表
- (void)replyListInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.10发送站内信
- (void)sendMessageInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.10.1 回复站内信
- (void)replyMessageInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.11删除站内信
- (void)deleteMessageInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 2.12发送手机验证码
- (void)sendVerificationCodeWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//* 2.14修改手机号码
- (void)updateUserTelephoneWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//* 2.15修改邮箱
- (void)updateUserEmailWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//*

//* 2.15  - 2.22 定义修改
- (void)Action:(NSString*)HTAPIString WithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//YJB 2016.5.19
-(void)YJBActionWithGetRequset:(NSString*)YJBAPIString WithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;

//* 3.1获取任务列表信息
- (void)taskListWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//* 3.2获取任务详情
- (void)taskDetailWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.3 猎手抢单
- (void)orderUserTaskWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.4取消订单
- (void)cancelTransOrderActionWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.5获取用户订单任务列表
- (void)userTaskListWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.6 获取用户订单任务详情
- (void)userTaskDetailWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;




//* 3.7确认交易
- (void)confirmTransActionWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.8确认好评
- (void)confirmCommentActionWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;



//* 3.9 上传交易截图
- (void)uploadDealPhotoActionWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


//*4.1 获取动态信息
- (void)threadInfoWithParameters:(NSDictionary*)_parameters success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


- (AFHTTPRequestOperation *)updateImagePostRequestWithURL:(NSString *)_url parameters:(NSDictionary *)_parameters
                                            formDataArray:(NSMutableArray *)formImageArray
                                                  success:(APIClientSuccess)_success failure:(APIClientFailure)_failure;


@end
